import request from '@/utils/request'

export default{
    //游戏条件查询分页
    pageList(pageNum,pageSize,searchObj){
        return request({
            url: `/game/getGamePageList/${pageNum}/${pageSize}`,
            method: 'post',
            //使用json格式传递 写法data：searchObj
            //使用j普通格式传递 写法params：searchObj
            data:searchObj
          })
    },

    removeGameId(id){
        return request({
            url: `/game/deleteGameById/${id}`,
            method: 'delete',
          })

    },

    saveGame(game){
        return request({
            url: `/game/insertGame`,
            method: 'post',
            data:game
          })
    },

    getGameById(id){
        return request({
            url: `/game/getGameById/${id}`,
            method: 'get',
          })
    },

    updateGame(game){
        return request({
            url: `/game/updateGame`,
            method: 'post',
            data:game
          })
    },

    batchRemove(idList) {
        return request({
          url: `/game/removeBatch`,
          method: `delete`,
          data: idList
        })
    },
    
    getGameList() {
      return request({
        url: `/game/getGameList`,
        method: `get`,
      })
    },
    getGameListDesc() {
      return request({
        url: `/game/getGameListDesc`,
        method: `get`,
      })
    },
}